\documentclass[12pt]{report}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{fbe_tez}
\usepackage{graphicx}

%
% Declarations
%
\title{SIMULATION AND WEB GAME DEVELOPMENT OF BODY WEIGHT DYNAMICS}
\turkcebaslik{VÜCUT AĞIRLIK SİMÜLASYONU VE WEB OYUNU GELİŞTİRME} \degree{B.S. in Industrial Engineering, Bogazici University, 2002}
\author{Mert Nuhoğlu}

\program{Industrial Engineering}

%
\supervisor{Prof. Yaman Barlas}
\examineri{Assist. Prof. Cengizhan Öztürk} 
\examinerii{Assist. Prof. Aybek Korugan}

\dateofapproval{24.09.2009}

\begin{document}
\pagenumbering{roman}
%
\makemstitle   

\makeapprovalpage

\begin{acknowledgements}
\end{acknowledgements}

\begin{abstract}

\end{abstract}

\begin{ozet}

\end{ozet}

\tableofcontents
\listoffigures
\listoftables

\begin{symabbreviations}
\end{symabbreviations}
\nopagebreak
\pagenumbering{arabic}


\chapter{Introduction and Literature Survey}\label{introduction}


Bu çalışmanın iki temel amacı vardır: i) Oyun amaçlı vücut ağırlığı simülasyon modeli geliştirmek. 
ii) Vensim veya benzeri bir editörde hazırlanmış herhangi bir sistem dinamiği modelini web ortamında çalışır ve son kullanıcılar tarafından oynanabilecek bir oyun haline getirmektir. Bunu sağlamak için, web tabanlı bir yazılım geliştirdik. Bu yazılımı hem test etmek, hem de genel kamu için yararlı bir örnek uygulama olarak sunmak için, vücut ağırlığı dinamiği modelini, web tabanlı bir oyun haline getirdik. Burada kullandığımız vücut ağırlığı dinamiği modeli, orjinali Hall tarafından geliştirilmiş modelin, bizim tarafımızdan değiştirilmiş halidir. Bu tez, hem değiştirilmiş Hall modelini, hem de web tabanlı simülasyon ve oyun yazılımı olan Meşe Palamudunu tarif ediyor.
Piyasada sistem dinamiği simülasyon modellerini webde çalışır hale getiren çeşitli araçlar halihazırda mevcut; fakat bunların sahip olduğu bazı temel kısıtlar, yeni bir yazılım geliştirmeyi gerektirecek kadar önemli. Bu temel kısıtların en başında, mevcut web yazılımlarının ticari ve kapalı kaynak ürünler olması geliyor. 
Ticari lisans, yazılımların kullanımını kısıtlayan bir engel oluşturur; fakat kapalı kaynak kodu olması bunun ötesinde bazı istenmeyen dolaylı sonuçlara sebep olur: Kapalı kaynak ürünler, orjinal programcıların dışındaki insanların, ürün üzerinden yeni bir araç geliştirmesini büyük ölçüde kısıtlar. Açık kaynak ve özgür yazılımlarda ise, ürünün orjinal geliştiricisinin hiç aklına gelmeyen veya gücünün yetmediği yepyeni araçlar ve kullanım alanları, bağımsız programcılar veya kullanıcılar tarafından geliştirilebilir. Bu ihtiyaç, bu tez çalışmasının temel gerekçesidir. Tez çalışmasında geliştirdiğimiz yazılımın, mevcut yazılımlardan farklılıkları, @ref Gerekçelendirme ve Kıyaslama kısmında detaylandırılıyor. 
Tez çalışmasının yazılım geliştirme kadar çok zaman alan kısmı web yazılımının işe yarar bir şekilde kullanımını gösterebileceğimiz bir dinamik sistem modeli bulmak. Bu konuda temel aldığımız kriterler şunlar:
İlk kriter: Çok sayıda insana pratik bir fayda sağlayabilecek, bilimsel yönü ağır olan bir problem bulmak. Böylece sistem dinamiğinin geniş kitleler tarafından kullanımını da test etmek istedik. 
@ref (jay forresterın 50. yıl münasebetiyle yazdığı, önemli problemlerle uğraşmanın gerekliliği makalesine değin)
Çok sayıda insanı ilgilendiren, önemli bir problemle uğraşmanın dolaylı bir faydası, farklı disiplinlerden bilim adamları ve uzmanların ilgisini sistem dinamiği yöntemine çekmek olacaktır. Sistem dinamiği yöntemi, karmaşık sistemlerle uğraşan pek çok bilim adamı ve uzmanın halihazırda uğraştığı problemlere önemli katkılar sağlayabilecek bir yöntemdir. Ne var ki, sistem dinamiği bilimsel bir yöntem olarak, rekabet içinde olduğu, diğer istatistik ve matematik temelli yöntemlere nazaran bilim adamları tarafından yeterince tecrübe edilmemiştir. Bu durum, karmaşık sistemlerle uğraşan bilim adamlarının üretkenliği açısından bir kayba sebep olmaktadır. Bu tezde geliştirdiğimiz yazılım ve örnek uygulamanın, bu sorunun çözümüne katkı sağlayabileceği düşüncesindeyiz. 
İkinci kriter: Sıfırdan yeni bir model geliştirmek yerine belli bir olgunluğa kavuşmuş bir model kullanmak. Böylece, model geliştirmenin gerektirdiği zaman ve emek maliyetinden tasarruf etmeyi amaçladık. Hall tarafından geliştirilmiş bir modeli temel aldık; fakat yine de modelin her bir parçasının tek tek geçerlemesini yeniden yaptık. Bu arada, modeli daha sadeleştirmek ve iyileştirmek için bazı değişiklikler yaptık. 



The aim of body weight model research in this thesis is to build a realistic simulation model of the long term body weight dynamics of the human. The body weight dynamics is mainly determined by the interaction of two components: energy intake and energy expenditure. But the interaction between these two components is not a simple mechanism as some people may believe. General public's view of body weight dynamics is that in order to lose weight you have to eat less and exercise more. The same is true for weight gain too: eat more and do less exercise in order to gain weight. But this world view does not reflect the real complexity of the reality.
A person makes diet and loses a few kilograms at first. Then he maintains his diet to lose more weight. But it doesn't happen anymore. Although he eats less than most people at the same weight, he doesn't lose anymore weight. This is due to the adaptation of the human body to new conditions. There are several negative feedback loops in the human body weight regulation that complicate changes in body weight. Actually some of these negative feedback loops are crucial for survival of the mankind in extreme conditions. But the living conditions of mankind improved so much that the mechanisms that were very beneficial in hard conditions became an obstruct in prosperous environment.
In general the negative feedback loops in the body weight regulation system counteract to the changes in the body weight. That is to say, if the person gains weight, the regulation mechanisms try to limit the gain. If the person loses weight, the same mechanisms try to limit the loss. 
Fighting with obesity is a crucial problem in modern world. Only in USA it is estimated that more than 100 billion dollars per year is spent on obesity treatments @ref. The health costs of obesity and psychological problems caused by it are not included. Most people have a simple and defective world view of how to lose weight. This misapprehension increases the psychological problems of obesity even deeper. People that try to lose weight try very hard, but they don't succeed. The failure in this fight causes the people to lose their self confidence.
The aim of this research project is to come up with a model-based tool that will allow people to track the changes in their body weight in long term. The tool should be useful for a person to get a deeper understanding of the body weight dynamics and to build a better dieting and exercising program for himself. Maybe the researchers will be able to use the simulation tool in order to find out easy to implement ways where the person loses weight and the metabolism rate of the person remains stable.


There are three types of studies in the literature that contain mathematical models related to body weight:
1. Short term energy metabolism models (Vicini (1997), Cobelli (2008))
2. Long term energy regulation models (Abdelhamed (2002), Hall (2006), Westerterp (1995), Payne (1977))
3. General dynamical analysis of body weight change (Chow (2008))
The difference between long term and short term energy regulation models is the length of time horizon. Time horizon in short term models ranges from a few minutes to a few hours. They try to analyze and understand how energy regulation occurs at a cellular or hormonal scale. Long term energy regulation models don’t consider fluctuations in the body that occur in a time scale shorter than one day. They try to analyze and understand long term dynamic behavior of body weight components. Time horizon is at least a few weeks.
The ultimate aim of this thesis is to build an easy to use tool for the use of general public. Therefore among these three types of models, second type is suitable for the aims of this thesis study. By having an easy tool that simulates the body weight dynamics, general public can make use of it in order to have a healthier life.



\chapter{Problem Description and Research Objective}\label{problem_description}


\chapter{Research Methodology}\label{research_methodology}


\chapter{Body Weight Model}\label{body_weight_model}


\section{Description of the Model}\label{description_of_the_model}
Body weight simulation model tries to build a general simulation model for body weight change in long term. The model integrates nutrition, metabolism, body composition and physical activity. The model does not only track and calculate the body weight, it also calculates the composition of it. The model takes food intake and physical activity as external variables. All the other variables related to the energy metabolism and body composition are internal to the model. Unit time of the model is one day. So metabolic activities depending on the daily rhtym of the body are not relevant to the model.

Body weight simulation model in this research is a modified version of Hall's work. Hall's original model is based on the Minnesota Starvation Experiment's data. Minnesota Experiment is an experiment done between 1994 and 1945. Its aim was to find out better ways of rehabilitation for the large masses of Europeans who were living under hard starvation for a few years. The experiment consisted of three phases: 
Control phase: The aim of this phase was to build baseline data where the body weight of the subjects were maintained in stability. It lasted 12 weeks and in this period 3200 kcal per day were given to the subjects.
Starvation phase: The aim in this phase was to reduce the body weight by 25%. It lasted 24 weeks. During this period 1570 kcal per day were given to the subjects.
Rehabilitation phase: The aim of this phase was to rehabilitate rapidly and safely.  2366 kcal per day were given to the subjects.
Total number of subjects in the experiment were 36. Detailed data of feeding, body weight and body composition were recorded during the experiment.

The model contains three macronutrient stocks (compartments): fat, carbohydrate (mostly glycogen) and protein. Moreover there is one more stock in the model. This is a hypothetical variable called as adaptive thermogenesis. There are four external inputs to the model. Daily caloric intakes of fat, carbohydrate, and protein are food intake variables. Daily level of physical activity is the fourth external input to the model. The model consists of three macronutrient stocks plus adaptive thermogenesis stock, and flows (fluxes) between them.
(@üst seviye flux diyagramı koy. 508 gibi)
Stocks in the model. F, G, P denote fat, glycogen (carbohydrate), and protein masses in the body. FI, CI, PI are energy intake variables short for fat, carbohydrate and protein. FatOx, CarbOx and ProtOx are oxidation rates of the corresponding masses. DNL and G3P are fat synthesis rates from glucose. \verb|GNG_F| and \verb|GNG_P| are gluconeogenesis rates, that is glucose synthesis rates from fat and protein, respectively.

Differential equations in the model are given in @figure:

\includegraphics[scale=0.5]{images/509.jpg} 
---
Differential equations giving the nutrient balance model (The rho parameters are energy densities of nutrients. M parameters are molecular masses of substances.)
There are three unknown independent variables in these differential equations: G, F, P. All other variables are either given parameters, inputs (CI, FI, PI) or dependent variables (GNG, DNL etc.). 
Dependent variables, they all depend on 4 independent variables. 
(@ buraya acaba değişkenlerin arasındaki bağımlılıkları gösteren bir çizge grafik koymalı mı?)
The causal loop diagram of the Hall's model is given in Fig ???
(@ causal loop diagram)
Causal loop diagram of Hall's model. All the causalities between variables are positive, if not explicitly stated. Food intake is the input variable. For simplification, nutrient compartments of glycogen, fat and protein are shown as Body Stock variable in the diagram. Flow is the change in the body's nutrients' stocks.
---
(@ hangi geri besleme döngüleri var. bunları tarif et)


\subsection{Overview of the Model}\label{overview}
\includegraphics[scale=0.5]{images/631.jpg} 
(@fig macro01)
The most simple form of the model is in @fig631. substance stock is the aggregate representation of all the material that composes the body. There is one aggregated inflow as "food intake" and one aggregated outflow as "oxidation". Naturally, this is an oversimplification of the material exchange of the body. Apart of oxidation there is also some amount of material outflow through excretory system. Actually the oxidation outflow contains excretory outflow implicitly because some parts of the protein molecules that are broken down and thrown away through excretory system are oxidized @ref. 

Our model contains three stocks that disaggregate body substance. They are protein, carbohydrate and fat. There are lots of other materials in human body. At least 70% of human body consists of water alone. There are also some organic materials that are not included in these three stocks such as nucleotides or hormones. The amounts of these materials are all closely correlated with the amounts of the three stocks in the model. Therefore our model defines the amounts of these materials as functions of the three material stocks in the model. 

A conceptually different stock from the material stocks is adaptive thermogenesis stock. This stock variable represents the ability of the body to adapt itself to the changing conditions of food intake. There are some controversy around this concept in the literature of energy metabolism. There are some published research that suggests that there is no adaptation of the body at all. But there are also several research suggesting the existence of the adaptation @ref. The fundamental physiological idea behind adaptive thermogenesis is that body cannot leave energy regulation to the willpower of the person only, because lack of energy resources in long term will certainly bring the body to a death. Therefore there must be some powerful enough control mechanisms that prevent death caused by long term energy deficiency. Actually there are several physiological explanations that might be the operational physics how adaptation occurs: Simply all the physiological activities that require energy inside the body are diminished to a lower amount during starvation. For example, active membrane transportation or cell division occurs more slowly and less frequently. This can be done by releasing and deploying less protein molecules that carry the physiological activities requiring energy.
So it seems reasonable that there exists a regulation mechanism that adapts body's physiological activities to the energy stock and inflow. During starvation all the activities are slowed down and during energy excess all the activities are speeded up. But of course there must be physical limits to the adaptation capacity of the body.
Another controvery occurs around the triggering cause of the adaptive thermogenesis. One possibility is that the changes in the energy intake triggers adaptation. Another possibility is that the changes in the energy stock triggers adaptation of the body. There is not enough evidence in the literature that approves which one is true. In our model, we reserved the causal relationship between energy intake and adaptation as done in Hall's model. 
In the most simplified overview of the model, there is one fundamental feedback loop: As the level of body substance increases the amount of oxidation increases, and this causes a relative decrease in the level of substance. So this loop is a negative feedback loop. 

\subsection{Main Sectors of the Model}\label{mainsectors}
\includegraphics[scale=0.5]{images/781.jpg} 
\label{fig:macro02}

@fig shows the causal relationship of the whole model in aggregated terms. There are 12 important conceptual variables shown in this diagram. The stocks and their flows are the same as in @fig (macro01). This diagram shows additionally the intermediate variables that control the flows.

Food intake is an external variable in this model. It is assumed to be determined by the person freely. This assumption is actually not valid. But for the purpose of our model this is acceptable. There are several feedback loops that control the amount of food intake desire and capacity of a person @ref (leptin meselesi). But the boundaries of our model doesn't include this kind of factors. If we had taken them into the model too, then our model couldn't be used by some person to test the effectiveness of a dieting habit.

Among these 12 variables, adaptation, food intake, substance, oxidation were explained in previous section @ref. This diagram is actually a detailed view of the link between substance and oxidation in @fig (macro01). The amount of body substance is a self limiting stock variable. An increase in body substance amount triggers mechanisms that increase the outflow of body substance, therefore it limits its own growth. Self limiting growth in this system occurs through two negative feedback loops: 
- Metabolic activities resist to the change in body substance. 
- Physical activity energy expenditure resists to the change in body substance.
The first loop is more important for an ordinary person since the share of resting metabolic rate takes around 60-70% of total energy expenditure for a normal person (@ref). In this loop body substance effects resting metabolic rate over three factors: metabolism of conversions, metabolism of turnovers, metabolism of body cells. Metabolism of conversions covers all the metabolic activities that involve conversion of an energy macronutrient (carbohydrate, fat or protein) to another one. Metabolism of turnovers covers all the energy requiring metabolic activities that construct or deconstruct macronutrients from their building stones. Metabolism of body cells covers all the energy requiring metabolic activities to maintain living conditions such as active membrane transportation, cellular division. Actually there is a partial overlap between these three variables. Metabolism of conversions and turnovers are actually parts of metabolism of body cells. But evenso we found it more suitable for the purpose of our model to break down metabolism of body cells into three parts. The reason behind this separation is that the effect of nutrition and body substance differs between these three components of metabolism. 
Metabolism of turnovers is dependent only on the current stocks of macronutrients. Stocks of macronutrients (carbohydrate, fat, and protein) are shown as aggregated in one body substance stock in Figure~\ref{fig:macro02}. There is a direct linear proportional causal relationship between substance stock and metabolism of turnovers. The level of body substance directly effects the amount of macronutrients to construct or deconstruct. The reason behind the positive linear relationship between the amount of nutrient turnover and nutrient stock is based on two assumptions. The first assumption is that the body tries to recover the amount of macronutrients deconstructed @tahmin. Namely, the constructed amount of macronutrients is more or less equal to the amount of deconstructed amount. The second assumption is that the amount of macronutrients deconstructed is a linear function of current stock of macronutrients. One component of this assumption is the deconstruction rate of protein. The model is based on that the amount of protein deconstruction is dependent on the average life time of a protein molecule. The model assumes that the average life time for protein molecules remains stable. The validity of these and other assumptions in the model are open to further research. Most of these assumptions are actually not based on specific proofs of physiological research, because these questions have not been studied in sufficient detail by researchers yet.
Metabolism of conversions is dependent on current stocks as well on inflow of macronutrients. The relationship is positive again. When there is more food intake or body substance, then there is more conversion of one macronutrient to another. 
Metabolism of body cells is dependent on current stocks of macronutrients only. The relationship is again positive. Actually metabolism of body cells is dependent mostly on one stock of macronutrient only: protein. Fat and carbohydrate stocks have comparatively very little effect on metabolism of body cells. This is due to the storage mechanism of fat and carbohydrate. Fat and carbohydrate molecules are stored in body in very efficient way. Most of the fat in the body is stored in fat cells (adipocytes). 90% of the content of these specialized cells is fat. Storing fat requires very little metabolic activity in the body. Therefore the share of fat stock in metabolism of body cells is very small. The share of carbohydrate stock in metabolism of body cells is also very small since the amount of stored carbohydrate inside the body at a certain time is very little (around 400 g) @ref. So the metabolism of body cells is mostly dependent on the level of protein stock. This is very reasonable since most of the metabolic activities inside the living organism is done by protein molecules. Apart of proteins there are also substances like nucleotides and some lipids that work in body metabolism. This model assumes that the amount of these other substances doesn't change for a healthy adult person. This assumption is mostly valid for real life too. The body composition of these substances is maintained more or less stable in a healthy adult person.
Resting metabolic rate is the energy requirement of an awaken person in resting conditions. It is not to be confused with the basal metabolic rate. Basal metabolic rate is the energy expenditure rate of the body during sleeping condition. But resting energy is more than sleeping. It contains basic movement activities like sitting, walking a few steps and eating. Approximately, resting energy expenditure makes up 60-70 percent of total energy expenditure @ref.
Resting metabolic rate is the sum of three metabolism components: metabolism of conversions, turnovers, and body cells. Adaptive thermogenesis is the fourth factor that effects resting metabolic rate. Adaptive thermogenesis is a counteracting mechanism of the body against the change in the energy intake. The model assumes that when there is a shortage of energy intake, then the body slows down all metabolic activities. When there is an excess of energy intake, then the body increases all metabolic activities.
For a normal person 20-30% of daily energy expenditure is due to physical activities. Physical energy expenditure is directly dependent on the body weight due to the basic Newtonian rule of $F = m \cdot a$. Therefore there is another negative feedback loop that limits the self growth of body substance. An increase in body substance stock will eventually cause its growth to slow due to the increase in physical energy expenditure rate. 
Thermic effect of food is the third component of energy expenditure shown in Figure~\ref{fig:macro02}. Approximately 10% of energy expenditure in a healthy adult person is due to the thermic effect of food. This is the energy expenditure spent for digestion and absorption of the foods. Thermic effect of food is a linear function of food intake. In our model thermic effect of food is not involved in any feedback loop. Anyway the decrease in energy intake is partially compensated by the decrease in thermic effect of food. This is not a feedback loop in our model, but it is another resistance to the change in food intake of a person.
Thermic effect of food, resting metabolic rate, and physical activity expenditure sum up to total energy expenditure of a person. Total energy expenditure has a linear positive effect on oxidation rate of the body, since oxidation is the only way for the body to provide the required amount of energy expenditure. Actually the body can also generate energy by anaerobic respiration but this is not relevant for our model due to a few reasons. Firstly, anaerobic respiration has a very small share in total oxidation. Secondly, anaerobic respiration occurs exceptionally rare only when there is not sufficient oxygen respiration. And whenever this happens, it can last for only a few minutes @ref. 
Oxidation is an outflow of body substance stock since during oxidation stocks of macronutrients are broken down and thrown away out of the body through exhalation.
\subsection{Whole Model in Detail}\label{wholemodel}
\includegraphics[scale=0.5]{images/786.jpg} 
\label{fig:wholemodel}
Figure~\ref{fig:wholemodel} shows the stock flow diagram of the whole model in detail. Actually this diagram still doesn't show constant values that have an effect on the variables. Understanding the model as a whole in one step is not easy. Therefore I will go over parts of the diagram. 
\includegraphics[scale=0.5]{images/781.jpg} 
\label{fig:model02_2}
Figure~\ref{fig:model02_2} is a simplified representation of the model in aggregated terms. In the simplified diagram, variables represent important sectors of the actual model. Section~\ref{conversionssector} covers conversions sector of the whole model which corresponds to the metabolism of conversions variable in Figure~\ref{fig:model02_2}. Section~\ref{conversionssector} covers conversions sector of the whole model which corresponds to the metabolism of conversions variable in Figure~\ref{fig:model02_2}. The next sections cover metabolism of turnovers, metabolism of body cells, body weight, oxidation, physical activity energy, and adaptive thermogenesis variables step by step as important, partially independent sections of the model. 
Total energy expenditure, resting metabolic rate, thermic effect of food, and food intake are not covered as seperate sections because their functions are pretty simple with respect to the other variables in Figure~\ref{fig:model02_2} (@soru section neye denir tam olarak? rmr ayrı bir section olacak kadar karmaşık değil, ama diğer sectionları içerdiğinden, bunu ayrı bir bölümde almakta fayda var.).
 
\subsection{Resting Metabolic Rate}\label{rmr}
\includegraphics[scale=0.5]{images/787.jpg} 
Figure~\ref{fig:rmr}
Resting metabolic rate is the energy requirement of an awaken person in resting conditions. It contains basic movement activities like sitting, walking a few steps and eating. Approximately, resting energy expenditure makes up to 60-70 percent of total energy expenditure @ref.
The function for resting metabolic rate is given in Equation~\ref{eq:rmr}. In this equation, resting metabolic rate consists of four terms: metabolism of body cells, metabolism of turnovers, metabolism of conversions, and ec. Among these four terms, ec is the only one that doesn't have any real life corresponding physical entity. 
\begin{equation}\label{eq:rmr}
	\verb|resting_metabolic_rate|=\verb|metabolism_of_body_cells| + \verb|metabolism_of_turnovers| + \verb|metabolism_of_conversions| + \verb|ec|
\end{equation}
In Section~\ref{mainsectors} we said that adaptive thermogenesis is the fourth factor that effects resting metabolic rate apart of the summation terms. In mathematical model this effect is contained in metabolism of body cells which is the major component of resting metabolic rate. 
As stated in Section~\ref{mainsectors}, metabolism of conversions covers all the metabolic activities that involve conversion of an energy macronutrient (carbohydrate, fat or protein) to another one. Metabolism of turnovers covers all the energy requiring metabolic activities that construct or deconstruct macronutrients from their building stones. Metabolism of body cells covers all the energy requiring metabolic activities to maintain living conditions such as active membrane transportation, cellular division. There is a partial overlap between these three variables. Metabolism of conversions and turnovers are actually parts of metabolism of body cells. But due to the benefits in modeling, the model seperates these two variables from metabolism of body cells.
The fourth summation term in Equation~\ref{eq:rmr}, ec is a special variable. There is no physical entity that corresponds to ec. Evenso ec has important uses for the model. 
First benefit of having ec is that ec allows the model to stay in energy balance. The value of ec in the model is calculated after everything else. It serves as a slack or surplus variable that compensates any lack or surplus in the energy balance state of the modelled person. 
Second benefit of having ec is that it corresponds to an implicit physical entity that arose as a side effect of the model. There is a partial overlap between these the variables metabolism of conversions, turnovers, and metabolism of body cells. The former two are actually parts of the last one. But for the purpose of our model, it is useful to break down metabolism of body cells into three parts. By dividing metabolism of body cells into three components, the effect of nutrition and body substance on metabolism of turnovers and conversions can be described more easily. So for a normal person, one that has similar metabolic characteristics as the people on whom the parameters used in the model are based, some of the metabolic activities are actually double counted in the model. 
Metabolism of body cells covers all the metabolic activities inside the body cells. In most of the cells, there is also some amount of conversion of macronutrients or construction and deconstruction of macronutrients. So metabolism of body cells actually contain in itself metabolism of turnovers and conversions. In order for these two concepts to be totally independent of each other, metabolism of body cells should be defined in such a way that it doesn't include any metabolic conversion or turnover activity. This is very difficult due to data measurement problems in micro scale. Therefore our model accepts double counting as a bearable side effect of having metabolism of conversions and turnover variables as seperate entities from metabolism of body cells.
\subsection{Conversions Sector}\label{conversionssector}
\includegraphics[scale=0.5]{images/782.jpg} 
\label{fig:conversions}
Figure~\ref{fig:macro02} shows metabolism of conversions as a single aggregate variable. This is actually a simplification of the variables in our model. Figure~\ref{fig:conversions} is a more detailed view of the model. In this figure conversions between the stocks of macronutrients are clearly shown. There are three flow variables representing the conversions: dnl, gng fat, and gng protein. dnl is short form for De Novo Lipogenesis which means synthesis of fat from carbohydrate. gng is short for gluconeogenesis which means generation of glucose from non-carbohydrate substances. There are two forms of gng: gng protein and gng fat. gng protein is conversion of protein molecules into carbohydrates and gng fat is conversion of fat into carbohydrate.
All the conversion flows have the same causality structure with one exception of gng protein. The amount of conversion from one macronutrient stock to another is a positive linear function of the origin stock and food intake. For example, gng fat is the flow from fat stock to carbohydrate stock. The amount of this flow is linearly proportional to amounts of fat stock and fat intake inflow. The reason behind this causal model is that when there is more substance then there will be more conversion of this substance to another form. The model assumes that the relationship is linear because there is no evidence to suggest a nonlinear relationship. Baseline variables are constant values that are normal levels of the respective variables. (@soru: baseline ne anlama geliyor, daha çok açıklamalı mı?) In reality, baseline values change depending on the characteristics of a person. But our model doesn't calibrate baseline values based on them. It presumes constant average baseline values based on the physiology literature.
All conversion variables are positive linear functions of the origin stock and food intake variables. The only exception to this causal structure is gng protein. gng protein depends on carbohydrate intake in addition to its origin stock and food intake. Carbohydrate intake has a protein sparing effect. Therefore carbohydrate intake has a negative effect on gng protein (\cite{Clore95}). 
Figure~\ref{fig:conversions} hides oxidation outflows for simplicity. Figure~\ref{fig:macro04} shows oxidation outflows additionally.
\includegraphics[scale=0.5]{images/783.jpg} 
\label{fig:macro04}
Figure~\ref{fig:macro04} shows that oxidation outflows have again the same causality structure mostly. They depend on the origin stock and food intake variables. Fat oxidation is the only exception. It depends only on the fat stock not on fat intake (\cite{Flatt85} \cite{Schutz89}). The oxidation functions of the relationship shown in Figure~\ref{fig:macro04} are all positive and linear. The reasoning behind this causality structure is similar to the reasoning with conversion flows. When there is more substance in the stocks or inflows, then the body tries to use more of them. 
Figure~\ref{fig:macro04} is actually a simplified representation of the causality structure of oxidation variables in our model. This stock flow diagram doesn't show nonlinear effects on oxidation used in the model. These will be explained in Section~\ref{oxidation}. 
Figure~\ref{fig:wholemodel} shows detailed causality structure of conversion variables. This has some differences from the simplified diagram Figure~\ref{fig:conversions}. Figure~\ref{fig:conversions_detailed} is extracted out of Figure~\ref{fig:wholemodel} where only variables directly effecting metabolism of conversions are shown. I put this diagram in order to highlight the correspondence of simplified stock flow diagram in Figure~\ref{fig:conversions} with the actual stock flow diagram of the model in Figure~\ref{fig:wholemodel}.
\includegraphics[scale=0.5]{images/788.jpg} 
\label{fig:conversions_detailed}
First important difference between the simplified version and actual version of the stock flow model is that conversion flows between the stocks are disconnected from either the origin or destination stock in simplified version. For example gng fat is a flow from fat stock to carbohydrate stock in simple model. But in actual model there is one outflow "gng fat out" from fat stock and one inflow "gng fat in" into carb stock. We had to disconnect conversion flows in actual model because the units of the stocks are not equivalent. Carb stock has the unit "gram of carbohydrate", fat stock has the unit "gram of fat", and protein stock has the unit "gram of protein". Therefore the fat amount coming out of fat stock through gng fat out cannot be the same amount of grams going into carbohydrate stock through gng fat in. 
The equations for the variables in the conversion sector are given in Equation~\ref{eq:conversions} in alphabetical order:
\begin{eqnarray}\label{eq:conversions}
   \nonumber  \verb|dnl_i|=&\verb|dnl| / \verb|cal_dens_f| \\
   \nonumber  \verb|dnl_out|=&\verb|min|( \verb|dnl| / \verb|cal_dens_c| , \verb|carb| / \verb|time_step| ) \\
   \nonumber  \verb|dnl|=&\verb|ci| * \verb|effect_of_glycogen_on_dnl| * \verb|cal_dens_c| \\
   \nonumber  \verb|eff_ci_on_gng_p|=&0.506 * \verb|normalized_change_in_carbohydrate_intake| \\
   \nonumber  \verb|eff_pi_on_gng_p|=&0.306 * \verb|normalized_change_in_protein_intake| \\
   \nonumber  \verb|effect_of_glycogen_on_dnl|=&\verb|normalized_glycogen_ratio| ** \verb|hill_dnl| / ( \verb|k_dnl| ** \verb|hill_dnl| + \verb|normalized_glycogen_ratio| ** \verb|hill_dnl| ) \\
   \nonumber  \verb|gng_fat_endog|=&\verb|baseline_gng_fat_endog| * \verb|normalized_lipolysis_rate| \\
   \nonumber  \verb|gng_fat_exog|=&\verb|exog_glycerol_per_kcal_fat_intake| * \verb|fat_intake| * \verb|cal_dens_c| \\
   \nonumber  \verb|gng_fat_in|=&\verb|gng_fat| / \verb|cal_dens_c| \\
   \nonumber  \verb|gng_fat_out|=&\verb|min|( \verb|gng_fat| / \verb|cal_dens_f| , \verb|fat| / \verb|time_step| ) \\
   \nonumber  \verb|gng_fat|=&\verb|gng_fat_endog| + \verb|gng_fat_exog| \\
   \nonumber  \verb|gng_protein_out|=&\verb|max|( 0.0 , \verb|gng_protein| / \verb|cal_dens_p|) \\
   \nonumber  \verb|gng_protein|=&\verb|max|( 0.0 , \verb|base_gng_p| * ( \verb|norm_p_ratio| - \verb|eff_ci_on_gng_p| + \verb|eff_pi_on_gng_p| ) ) \\
   \nonumber  \verb|gngp_i|=&\verb|gng_protein| / \verb|cal_dens_c| \\
   \nonumber  \verb|metabolism_of_conversions|=&( 1.0 - \verb|efficiency_dnl| ) * \verb|dnl| + ( 1.0- \verb|efficiency_gng| ) * ( \verb|gng_fat| + \verb|gng_protein| ) \\
   \nonumber  \verb|norm_p_ratio|=&\verb|protein| / \verb|baseline_protein| \\
   \nonumber  \verb|normalized_glycogen_ratio|=&\verb|carb| / \verb|base_carb| \\
\end{eqnarray}
The final outcome of conversion sector is metabolism of conversions. This is defined in Equation~\ref{eq:metabolism_of_conversions}
\begin{equation}\label{eq:metabolism_of_conversions}
   \verb|metabolism_of_conversions|=( 1.0 - \verb|efficiency_dnl| ) * \verb|dnl| + ( 1.0- \verb|efficiency_gng| ) * ( \verb|gng_fat| + \verb|gng_protein| ) \\
\end{equation}
Metabolism of conversions is the energy expenditure rate during the metabolic activities of macronutrient conversions. There are three macronutrient conversions: dnl (carbohydrate to fat), gng fat (fat to carbohydrate) and gng protein (protein to carbohydrate). The efficiency of dnl is 0.8 (\cite{Flatt1970}). The efficiency of gng is 0.8 too (\cite{Blaxter1989}).
gng protein is defined in Equation~\ref{eq:gng_protein}
\begin{eqnarray}\label{eq:gng_protein}
   \nonumber  \verb|gng_protein|=&\verb|max|( 0.0 , \verb|base_gng_p| * ( \verb|norm_p_ratio| - \verb|eff_ci_on_gng_p| + \verb|eff_pi_on_gng_p| ) ) \\
   \nonumber  \verb|base_gng_p|=100.0 \\
   \nonumber  \verb|norm_p_ratio|=&\verb|protein| / \verb|baseline_protein| \\
   \nonumber  \verb|eff_ci_on_gng_p|=&0.506 * \verb|normalized_change_in_carbohydrate_intake| \\
   \nonumber  \verb|normalized_change_in_carbohydrate_intake|=\verb|change_in_carbohydrate_intake| / \verb|baseline_carbohydrate_intake| \\
   \nonumber  \verb|eff_pi_on_gng_p|=&0.306 * \verb|normalized_change_in_protein_intake| \\
   \nonumber  \verb|normalized_change_in_protein_intake|=\verb|change_in_protein_intake| / \verb|baseline_protein_intake|
\end{eqnarray}
A more condensed mathematical definition for gng protein is given in Equation~\ref{eq:gng_protein_math}.
% \begin{equation}\label{eq:gng_protein_math}
%	gng_p = gng_{p,b} \left[ \left( { {p} \over {p_b} } - \Gamma_c \left( { {\Delta ci} \over {ci_b} } \right) + \Gamma_p  \left( {{\Delta pi} \over {pi_b}} \right) \right]
%\end{equation}
The mapping between symbolic names in condensed mathematical form and long names in detailed form is given in Table~\ref{table:conversion_translations}.
\begin{tabular}{|r|r|}\label{table:conversion_translations}
   % \hline
   symbol & long name\\
   \hline
   $gng_p$ & \verb|gng_protein|\\
   \hline
   $gng_{p,b}$ & \verb|base_gng_p|\\
   \hline
   $p$ & \verb|protein|\\
   \hline
   $p_b$ & \verb|baseline_protein|\\
   \hline
   $\Gamma_c$ & \verb|0.5|\\
   \hline
   $\Delta ci$ & \verb|change_in_carbohydrate_intake|\\
   \hline
   $ci_b$ & \verb|baseline_carbohydrate_intake|\\
   \hline
   $\Gamma_p$ & \verb|0.3|\\
   \hline
   $\Delta pi$ & \verb|change_in_protein_intake|\\
   \hline
   $pi_b$ & \verb|baseline_protein_intake|\\
   \hline
   ${{\Delta pi} \over {pi_b}}$ & \verb|normalized_change_in_protein_intake|\\
   \hline
   ${ {\Delta ci} \over {ci_b} }$ & \verb|normalized_change_in_carbohydrate_intake|\\
   \hline
\end{tabular}
There are two special parameters $\Gamma_c$ and $\Gamma_p$. These parameters are constant values that represent effects of carbohydrate and protein intakes on gng protein. Hall determined their values by solving Equation~\ref{eq:gng_protein_math} using two sets of data. Our model uses these values. 
Hall estimated the value for baseline gng protein (\verb|base_gng_p|) as 100 kcal/day. This estimation is based on a measurement study with multiple isotopic tracer methodology of Nurjhan 1995 \cite{Nurjhan1995}.  

\subsection{Metabolism of Turnovers Sector}\label{turnovers}

Section~\ref{turnovers}



\subsection{Metabolism of Body Cells Sector}\label{bodycells}


\subsection{Body Weight Sector}\label{bodyweight}


\subsection{Oxidation Sector}\label{oxidation}

---@sil: conversions kısmından kopya---
Figure~\ref{fig:macro04} shows oxidation outflows additionally.
\includegraphics[scale=0.5]{images/783.jpg} 
\label{fig:macro04}
Figure~\ref{fig:macro04} shows that oxidation outflows have again the same causality structure mostly. They depend on the origin stock and food intake variables. Fat oxidation is the only exception. It depends only on the fat stock not on fat intake (\cite{Flatt85} \cite{Schutz89}). The oxidation functions of the relationship shown in Figure~\ref{fig:macro04} are all positive and linear. The reasoning behind this causality structure is similar to the reasoning with conversion flows. When there is more substance in the stocks or inflows, then the body tries to use more of them. 
Figure~\ref{fig:macro04} is actually a simplified representation of the causality structure of oxidation variables in our model. This stock flow diagram doesn't show nonlinear effects on oxidation used in the model. These will be explained in Section~\ref{oxidation}. 

\subsection{Physical Activity Energy Sector}\label{pae}


\subsection{Adaptive Thermogenesis Sector}\label{adaptivethermogenesis}


\section{Customization of the Model}\label{customization_of_the_model}


\section{Validation Tests}\label{validation_tests}

\section{Scenario Analysis for Normal Subjects}\label{scenario_analysis_for_normal_subjects}


\chapter{Web Game Application Development}\label{web_game_application_development}


\chapter{Future Development Areas}\label{future_development_areas}


\chapter{Conclusions}\label{conclusions}
\chapter{Appendix A. Body Weight Websim User Guide}\label{appendix_a}
\chapter{Appendix B. Useful Software Tools Developed During Research}\label{appendix_b}



\end{document}
